﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ornament.MemberShip;
using Ornament.MemberShip.Module.Presenters;
using Ornament.MemberShip.Module.Views;

public partial class Admin_MemberAdmin_Controls_CreateUserWizard : UserControl, ICreateUserView
{
    #region ICreateUserView Members

    public void UpdateOn(User user)
    {
        user.Information.IsApproved = IsApprovedCheckBox.Checked;
        user.Information.IsLockout = IsLockoutCheckBox.Checked;
        //分配用户
        RoleAssign1.AssignRoleTo(user);
        UserGroupAssign1.AssignUserGroupTo(user);
        OrgAssign1.AssignOrgTo(user);
    }

    public CreateUserPresenter Presenter { get; set; }

    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    public string CreateUser()
    {
        return RegUserCtl1.CreatingUser();
    }

    #endregion

  

    protected void Page_Load(object sender, EventArgs e)
    {
        Presenter = new CreateUserPresenter(this);

        if (!IsPostBack)
        {
            Presenter.InitilizeView();
        }
        Presenter.ViewLoad();
    }


    protected void wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        Presenter.SaveChange();
    }
}